<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="UTF-8">
    <title>Your Title</title>
</head>
<script src="https://ss.zlzblog.com:30999/gh4riovd/jquery.min.js"></script>
<script src="player.js"></script>
<body>
<div id="content">
    <div id="loading">

    </div>
    <div id="content_player">

    </div>
</div>

</body>
</html>
<script>
    function downIndex(vid, url) {
        let result;
        $.ajax({
            //${pageContext.request.contextPath}用于取后端方法的绝对路径的项目名
            url: 'http://localhost:8081/m3u8/proxy?url=' + url,
            type: "GET",
            async: false,
            success: function (data) {
                result = data
            }
        });
        return result
    }

    $(document).ready(function () {
        JSON.stringify()
        var queryString = window.location.search;
        // 去掉开头的?
        queryString = queryString.substring(1);
        var pairs = queryString.split('&');
        var params = {};
        for (var i = 0; i < pairs.length; i++) {
            var pair = pairs[i].split('=');
            var key = decodeURIComponent(pair[0]);
            var value = decodeURIComponent(pair[1]);
            params[key] = value;
        }
        const newUrl = downIndex(params.vid, params.url)
        console.log(newUrl)
        document.getElementById('player').innerHTML =
            '<div style="height:26px; background-color:#2E2E2E; line-height:26px; color:#aaa;">&nbsp;线路:&nbsp;<a  id="jx0"  target="zzapi"  href="' +
            parent.jxAapi + parent.now + '&userId=' + parent.vid
        '" onclick="col(0);"><font style="color:#aaa">' +
        parent.jxAname +
        '</font></a> &nbsp;&nbsp;&nbsp;<a id="jx1" target="zzapi"  href="' +
        parent.jxBapi + parent.now +
        '" onclick="col(1);" ><font style="color:#aaa">' +
        parent.jxBname +
        '</font></a>&nbsp;&nbsp;&nbsp;<a id="jx2" target="zzapi"  href="' +
        parent.jxCapi + parent.now +
        '" onclick="col(2);" ><font style="color:#aaa">' +
        parent.jxCname +
        '</font></a> &nbsp;&nbsp;&nbsp;<a id="jx3" target="zzapi"  href="' +
        parent.jxDapi + parent.now +
        '" onclick="col(3);"><font style="color:#aaa">' + parent.jxDname +
        '</font></a> &nbsp;&nbsp;&nbsp;<a id="jx4" target="zzapi"  href="' +
        parent.jxEapi + parent.now +
        '" onclick="col(4);" ><font style="color:#aaa">' +
        parent.jxEname +
        '</font></a> </div><div style="height:calc(100% - 26px);">' +
        '<iframe name="zzapi" id="zzapi" src="' +
        jxapi[jxnum] +
        parent.now + '&userId=' + parent.vid
        '" scrolling="0" frameborder="0" width="100%" height="100%" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen" webkitallowfullscreen="webkitallowfullscreen"></iframe></div>'
        
    });
</script>
<style>
    html, body, #content {
        height: 100%;
        width: 100%;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }

    #content {
    }
</style>